package composite.pattern;

import composite.pattern.employee.Employee;

public class Test {
    public static void main(String[] args) {
        final Employee ceo = new Employee("one", "CEO");
        final Employee headSales = new Employee("sale", "Head Sales");
        final Employee headMarketing = new Employee("market", "Head Marketing");

        final Employee saleOne = new Employee("sale one", "sale");
        final Employee saleTwo = new Employee("sale two", "sale");

        final Employee marketOne = new Employee("market one", "market");
        final Employee markeTwo = new Employee("market Two", "market");

        ceo.add(headSales);
        ceo.add(headMarketing);

        headSales.add(saleOne);
        headSales.add(saleTwo);

        headMarketing.add(marketOne);
        headMarketing.add(markeTwo);

        for (Employee e : ceo.getSubordinates()) {
            System.out.println(e.toString());
            for (Employee e1 : e.getSubordinates()) {
                System.out.println(e1.toString());
            }
        }
    }
}
